package com.yq.socket1.day1.v2;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;
import java.util.logging.SocketHandler;

/**
 * @author 3307235355@qq.com
 * @description
 * @since 2022/07/01 09:58
 */
public class Client {
    public static void main(String[] args) throws IOException {
        //    创建客户顿的socket
        Socket socket = new Socket("127.0.0.1", 8888);
        //    创建scanner
        Scanner scanner = new Scanner(System.in);
        //    while
        while (true){
            //    键盘接收数据
            String s = scanner.nextLine();

            //    从socket中获取输入流
            OutputStream out = socket.getOutputStream();
            out.write(s.getBytes());

            //    输入数据

        }


    }
}
